package com.technology.education.data.model

import android.os.Parcel
import android.os.Parcelable

/**
 *@author:create by BZY
 *Date: 2022/3/17 10
 * 课程相关model
 */
data class CourseCategory(
    val children: List<CourseCategory>?,
    val id: String,
    val name: String,
    var selected:Boolean=false
):Parcelable{
    constructor(parcel: Parcel) : this(
        parcel.createTypedArrayList(CREATOR),
        parcel.readString()?:"",
        parcel.readString()?:""
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeTypedList(children)
        parcel.writeString(id)
        parcel.writeString(name)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<CourseCategory> {
        override fun createFromParcel(parcel: Parcel): CourseCategory {
            return CourseCategory(parcel)
        }

        override fun newArray(size: Int): Array<CourseCategory?> {
            return arrayOfNulls(size)
        }
    }

}

